﻿using mars_server.csharp.cache;
using mars_server.csharp.CO;
using mars_server.csharp.socket;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace mars_server.csharp.controller
{
    class HeartController
    {
        private HeartController() { }
        private static readonly HeartController instance = new HeartController();
        internal static HeartController Instance
        {
            get
            {
                return instance;
            }
        }


        public void dealHeartRequest(MessageCO messageCO , UserSocket userSocket)
        {
            foreach (UserSocket myuserSocket in UserSocketCache.UserSocketList)
            {
                if (myuserSocket.client.Client.RemoteEndPoint.ToString()
                    .Equals(userSocket.client.Client.RemoteEndPoint.ToString()))
                {
                    myuserSocket.HeartBeat = 5;
                    break;
                }
            }
        }


    }
}
